
using Qdb.CS.Internal.Messages;
using Qdb.Internal;

namespace Qdb.CS.Internal.Messages
{
	public sealed class MSetSemaphore : MsgD, IMessageWithResponse
	{
		public Msg ReplyFromServer()
		{
			int timeout = ReadInt();
			string name = ReadString();
			LocalObjectContainer stream = (LocalObjectContainer)Stream();
			bool res = stream.SetSemaphore(Transaction(), name, timeout);
			return (res ? (Msg)Msg.Success : Msg.Failed);
		}
	}
}
